Mobile computing devices such as laptops, mobile phones, and other devices having a display include graphics processing systems that draw various objects via a graphics pipeline. The process of the graphics pipeline that produces the objects for display is known as rendering. For purposes of rending an object, the object is composed of “primitives” which are more simple shapes such as triangles or other suitable polygons. The primitives are generated via groups of pixels where each pixel may include a color, texture, opacity and luminance characteristic. In order to create images that appear three dimensional (3D) on the display, various 3D attributes may be computed by the graphics pipeline such as light absorption, refraction and reflection by the various objects and their respective surfaces.
These characteristics are then applied to pixels corresponding to the regions on an image, composed of one or more objects, so that the image is realistic looking and appears to be a 3D image. In cases where lighting is applied to the pixels of an object, the amount of lighting is determined based on the position of a light source. FIG. 1 provides an example of how lighting may be applied to an object having a surface 103. For a given pixel “P”, an angle is determined between the rays emanating from a light source 101 to the pixel P. This ray is represented by the vector “L”. The vector “R” represents a ray in the direction of the specular reflection from the surface 103 at pixel P and at an angle of 2θ from the light vector L. That is, the angle of incidence occurs at an angle θ to a vector “n” which is normal to the surface 103 at pixel P. The angle of incidence is equal to the angle of reflection and therefore R is likewise at an angle θ to the normal vector n. The eye space or camera space may be defined by a line of sight vector “S” which is defined as a ray with respect to a hypothetical eye 105 and by an angle α to the reflected ray vector R. That is, the vector S defines the specular reflection with respect to a viewer's line of sight position. Specular reflection refers to light perfectly reflected, as by a mirror, from the light source 101 to the viewer, i.e. the hypothetical eye 105.
Specular reflection becomes visible when the surface normal vector n is oriented halfway between the light vector L and line of sight vector S. That is, the so-called “half-angle” direction or “half vector” is a surface normal vector bisecting the angle formed by a light vector of incidence and a reflected ray pointing in the line of sight of the viewer. If the hypothetical eye 105 were positioned at the reflected ray R (i.e. if R was at the line of sight) then the viewer would observe the specular reflection of light source 101, because the normal vector bisects the angle 2θ. As the angle α increases, the magnitude of the specular reflection will change or the specular reflection may no longer be visible. For modeling purposes, the remaining reflective portions are defined as reflections from microfacets of the surface 103, where each microfacet has its respective normal vector. These microfacets may refer to the primitives, i.e. the triangles or polygons that make up the object to be rendered. The consideration of distribution of the normal vectors on microfacets is determined by the reflection model utilized such as the Phong reflection model (also known as Phong lighting). That is, FIG. 1 illustrates that for a given surface, the direction of light and the reflection model (or lighting model) applied will determine the visibility and appearance of specular highlights.
Shadowing techniques may also be applied to objects of an image. An example is shown in FIG. 2, where an object 203 intersects a light source 201 to project a shadow 207 onto a background 205. A shadowing technique known as shadow buffering or shadow mapping computes the distance from the light source to the closest object for each light ray, and manages the computed distances using z-buffering techniques, also referred to as depth buffering. When treating an object from the point of view of the light source, the computed depth values are referred to as a shadow buffer or shadow map. In order to render the image, the shadow buffering technique checks for object intersections by computing the distance from the light source at a point of interest and comparing it to the depth values stored in the shadow buffer that are close to the ray emanating from the point of interest to the light source. If the distance from the light source to the point of interest is greater than the shadow buffer depth value then the nearby ray is shadowed, because it is assumed to intersect an object that is closer to the light source than the point of interest.
The shadow buffering technique has the drawback of requiring depth buffering. Although other shadowing techniques exist such as projected textures, stencil shadow volumes, etc., these other shadowing techniques also have drawbacks because they require buffering or require additional textures and the associated graphics processing computations.